package  com.fyyg.common.page;

import java.io.Serializable;

/**
 * 分页查询参数
 * @author hang.ouyang
 *
 * @date 2016年3月17日 上午10:04:59
 */
public class PageParam<P> implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 7471640195781285642L;
	
    private P p;  //查询参数对象
    private int pageNo = 1;
    private int pageSize = 20;
    private int dataTotal = 0;
    private String sort;
    private boolean isQueryTotal = true;

    public P getP() {
        return p;
    }

    public void setP(P p) {
        this.p = p;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getDataTotal() {
        return dataTotal;
    }

    public void setDataTotal(int dataTotal) {
        this.dataTotal = dataTotal;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public boolean isQueryTotal() {
        return isQueryTotal;
    }

    public void setQueryTotal(boolean queryTotal) {
        isQueryTotal = queryTotal;
    }

    public PageParam() {
    }
    public PageParam(P p) {
        this.p = p;
    }
    public PageParam(P p, int pageNo, int pageSize) {
        this.p = p;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

    public PageParam( P p, int pageNo, int pageSize,String sort) {
        this.p = p;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.sort = sort;
    }

    public PageParam(P p, int pageNo, int pageSize, int dataTotal, String sort, boolean isQueryTotal) {
        this.p = p;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.dataTotal = dataTotal;
        this.sort = sort;
        this.isQueryTotal = isQueryTotal;
    }

    @Override
    public String toString() {
        return "PageParam{" +
                "p=" + p +
                ", pageNo=" + pageNo +
                ", pageSize=" + pageSize +
                ", dataTotal=" + dataTotal +
                ", sort='" + sort + '\'' +
                '}';
    }
}
